  {% extends "myadmin/base.html" %}

  {% block mainbody %}
  <script>
    //自定义执行信息删除提示判断，参数uu是成功的删除url地址
    function doDel(uu){
      if(confirm("确定要删除吗？")){
        //网页跳转
        window.location=uu;
      }
    }
  </script>
  <h2>
    菜品类别信息浏览
  </h2>
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
        <th>id号</th>
        <th>列表名称</th>
        <th>父类别pid</th>
        <th>路径path</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      {% for vo in typelist %}
        <tr>
          <td>{{ vo.id }}</td>
          <td>{{ vo.pname }}|--{{ vo.name }}</td>
          <td>{{ vo.pid }}</td>
          <td>{{ vo.path }}</td>
          <td>
            <a href="{% url 'myadmin_type_add' vo.id %}" class="btn btn-mini btn-success">添加子类别</a>
            <a href="{% url 'myadmin_type_edit' vo.id %}" class="btn btn-mini btn-primary">编辑</a>
            <a href="javascript:doDel('{% url 'myadmin_type_del' vo.id %}')" class="btn btn-mini btn-danger">删除</a>
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
  {% endblock %}